package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.*;
import one.stand.response.CompanyPhotoResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 访问记录管理
 * @author Administrator
 */
@RestController
@RequestMapping("/record")
public class RecordController extends BaseController {

    /**
     * 添加咨询记录
     *
     * @return
     */
    @PostMapping("addConsultRecord")
    public ResultModel<Boolean> addConsultRecord(@RequestBody ConsultRecordRequest request) {
        return recordService.addConsultRecord(request);
    }

    /**
     * 添加商品转发记录
     *
     * @return
     */
    @PostMapping("addGoodsForwardRecord")
    public ResultModel<Integer> addGoodsForwardRecord(@RequestBody GoodsForwardRecordRequest request) {
        return recordService.addGoodsForwardRecord(request);
    }

    /**
     * 使商品转发记录有效
     *
     * @return
     */
    @PostMapping("validGoodsForwardRecord")
    public ResultModel<Boolean> validGoodsForwardRecord(@RequestBody GoodsForwardRecordRequest request) {
        return recordService.validGoodsForwardRecord(request);
    }

    /**
     * 添加文章转发记录
     *
     * @return
     */
    @PostMapping("addDynamicForwardRecord")
    public ResultModel<Boolean> addDynamicForwardRecord(@RequestBody DynamicForwardRecordRequest request) {
        return recordService.addDynamicForwardRecord(request);
    }

    /**
     * 添加拨打电话记录
     *
     * @return
     */
    @PostMapping("addCallsPhoneRecord")
    public ResultModel<Boolean> addCallsPhoneRecord(@RequestBody CallsPhoneRecordRequest request) {
        return recordService.addCallsPhoneRecord(request);
    }

    /**
     * 查询企业配置图片
     *
     * @param request
     * @return
     */
    @PostMapping("selectCompanyPhoto")
    public ResultModel<List<CompanyPhotoResponse>> selectCompanyPhoto(@RequestBody CompanyPhotoRequest request) {
        return recordService.selectCompanyPhoto(request);
    }
}
